home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 71 / MOBICLIC 71.ISO / mac / DATA / COMMUN / temp0001 / 00209_Script_GESTION_FLASH_AUDIO_FLASH < prev    next >
Text File  |  2004-12-05  |  4KB  |  119 lines

  1. global gze_Label,g_ZFlashsound
  2. property p_cettePiste, p_Nodepiste,p_SWF,pEscape,p_aiguillage, pNopisteSon,p_start,p_Musik,p_acteur
  3. property p_nomaction,pNbFrames,pSilence,p_attente
  4. ----------------------------------
  5. on getPropertyDescriptionList me
  6.   return [\
  7. #pNopisteSon:[#comment:"No piste son:",#format:#integer,#range:[2,3,4,5,6,7,8],#default: 3],\
  8.  #p_aiguillage:[#comment:"branchement α la sortie :",#format:#string,#range:["frame suivante","marker suivant"],#default: "marker suivant"],\
  9. #p_Musik:[#comment: "gestion musique?",#format: #string,#range:["la couper","la laisser","la relancer"], #default:"la laisser"],\
  10. #p_attente:[#comment: "boucle d'attente α la fin du swf ?",#format:  #boolean, #default:FALSE]\
  11.  ]
  12. end
  13. ----------------------------------------
  14. on beginsprite me
  15.   p_Nodepiste = me.spriteNum
  16.   p_cettePiste = sprite(p_Nodepiste)
  17.   p_acteur =  p_cettePiste.member.name
  18.   p_SWF = p_cettePiste.member
  19.   p_nomaction = p_SWF.name
  20.   fin = length(p_nomaction)
  21.   if p_nomaction.char[fin-1..fin] = "_M" then
  22.     pSilence = 1
  23.   else
  24.     pSilence = 0
  25.   end if
  26.   p_start = the frame
  27.   pEscape = p_cettePiste.endFrame
  28.   pNbFrames = p_SWF.framecount
  29.   gze_Label = the frameLabel
  30. end
  31. -----------------------------------
  32. on prepareFrame me
  33.   global gFlagcurseur
  34.   if p_cettePiste.mouseOverButton then
  35.     if not(voidP(gFlagcurseur)) then
  36.       case(gFlagcurseur) of
  37.         280,260,290:
  38.           p_cettePiste.cursor = gFlagcurseur
  39.       end case
  40.     end if
  41.   else
  42.     p_cettePiste.cursor = -1
  43.   end if
  44. end
  45. --------------------------------
  46. on exitFrame me
  47.   the soundKeepDevice = 0
  48.   if  the frame = p_start then----------------sur la premiΦre frame du swf
  49.     case(p_musik) of----------------------on coupe Θventuellemnet la musique
  50.       "la couper":
  51.         coupeson(1)
  52.         niveauSon()
  53.       "la laisser":
  54.         nothing
  55.       "la relancer":
  56.         niveauSon()
  57.         puppetSound(1,"MUSIK_"&zRacine())
  58.     end case
  59.   else
  60.     if the frame = pEscape then----------------sur la derniΦre frame du swf
  61.       if voidP(g_ZFlashsound) then g_ZFlashsound = 0
  62.       case(g_ZFlashsound) of
  63.         0: --aucun son n'a ΘtΘ lancΘ
  64.           go the frame
  65.         1:
  66.           if not(soundBusy(pNopisteSon)) and p_cettePiste .playing = 0  then----------------si le son s'arrΩte et que le swf est arrΩtΘ
  67.             if p_cettePiste.frame = pNbFrames -1 then------------------------------------------si le swf est sur l'avant derniΦre frame
  68.               p_cettePiste.gotoframe(p_cettePiste.frame + 1)
  69.               case(p_attente) of
  70.                 0:--si branchement en fin de swf
  71.                   niveauSon()
  72.                   aiguillage(p_aiguillage)---------------on sort de la boucle gloabale du swf dans Director
  73.                 1:--si boucle d'attente en fin de swf
  74.                   cursor 280
  75.                   go the frame---------------------------on continue α boucler dans Director
  76.               end case
  77.             else
  78.               if p_cettePiste.frame = pNbFrames then------------------------------------------si le swf est sur la derniΦre frame
  79.                 go the frame
  80.               else------------------------------------------si le swf n'est ni sur la derniΦre frame ni l'avant derniΦre
  81.                 p_cettePiste.gotoframe(p_cettePiste.frame + 1)
  82.                 play(p_cettePiste)
  83.                 go the frame
  84.               end if
  85.             end if
  86.           else
  87.             go the frame
  88.           end if
  89.       end case
  90.     end if
  91.   end if
  92.   
  93. end
  94. ---------------------------------------
  95. on aiguillage ZUT
  96.   case(ZUT) of
  97.     "frame suivante":------------------------------branchement α la frame suivante
  98.       go the frame +1
  99.     "marker suivant":------------------------------branchement au marker suivant
  100.       go marker(+1)
  101.   end case
  102. end
  103. ------------------------------------
  104. on mouseUp me
  105.   coupeson(pNopisteSon)
  106.   niveauSon()
  107.   --if p_cettePiste.frame = pNbFrames and p_attente = 0 then
  108.     if p_attente = 0 then
  109.       aiguillage(p_aiguillage)----------------------------------on sort de la boucle
  110.     end if
  111. end
  112. ------------
  113. on endSprite me
  114. cursor -1
  115. coupeson(pNopisteSon)
  116. niveauSon()
  117. end
  118. ----------------
  119.